package devbureau.fstore.common;

public class UserImpl implements User{

    private String password = null;
    private String login = null;
    private String firstName = null;
    private String lastName = null;
    private Integer roleId = null;
    private String roleLabel = null;
    private Boolean active = null;

    /**Default constructor for reflection transfering purposes*/
    public UserImpl(){
        
    }

    public UserImpl(String login, String firstName, String lastName,Integer roleId,Boolean active) {
        this(login,firstName,lastName,roleId,active,null);
    }

    public UserImpl(String login, String firstName, String lastName,Integer roleId,Boolean active,String roleLabel) {
        this.login = login;
        this.firstName = firstName;
        this.lastName = lastName;
        this.roleId = roleId;
        this.roleLabel = roleLabel;
        this.active = active;
    }

    public String getLogin() {
        return login;
    }

    public String getFirstName() {
        return firstName;
    }

    public String getLastName() {
        return lastName;
    }


    /**This method is used for getting UI display name
     * @return firstName + " " + lastName
     */
    public String getDisplayName() {
        return getFirstName() + " " + getLastName();
    }
    @Override
    public String toString() {
        StringBuilder buffer = new StringBuilder();
        buffer.append(login + " " +firstName + " " + lastName);
        return buffer.toString();
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getRoleId() {
        return roleId;
    }

    public String getRoleLabel() {
        return roleLabel;
    }

    public Boolean isActive(){
        return active;
    }
}
